<?php
namespace app\index\controller;

use think\api\Client;
use think\cache\driver\Redis;
use think\Controller;
class About extends Controller
{
    public function index()
    {
        $setting = $this->setting();
        $this->assign([
            'setting' => $setting['setting'],
            'index_menu_arr' => $setting['index_menu_arr'],
            'nav' => $this->nav(),
            'action' => request()->action(),
            'footer_about' => $setting['footer_about'],
            'footer_about_we' => $setting['footer_about_we'],
        ]);
        return view("index");
    }
    public function setting()
    {
        $setting = db("setting")->order("id desc")->find();//查询设置
//        dump($setting);die;
        $index_menu_arr = explode("#",$setting['index_menu']);//首页按钮
        $footer_about = explode("#",$setting['footer_about']);//关于七星
        $footer_about_we = explode("#",$setting['footer_about_we']);//关于我们
        $data = [
            'setting' => $setting,
            'index_menu_arr' => $index_menu_arr,
            'footer_about' => $footer_about,
            'footer_about_we' => $footer_about_we,
        ];
        return $data;
    }
    public function nav()
    {
        $nav = db("nav")->select();
        return $nav;
    }
}